package com.erpanderp.wam.usm.model.entity.timesheet;

import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;

import javax.persistence.Transient;

import com.erpanderp.wam.adm.model.entity.RoleService;

public class TimesheetDetail implements Comparable<TimesheetDetail>{
	private Long timesheetdetailId;
	private Timesheet timesheet;
	private Date timesheetDate;
	private String dayOfWeek;
	private Date inTime;
	private Date outTime;
	private String inTimeString;
	private String outTimeString;
	private String activity;
	private String timesheetDetailStatus; //P/SL/CL/AWL etc
	private String duration;
	private String securityPerson;
	private Date createDate;
	private Date dateModified;
	private String createdBy;
	private String modifiedBy;
	private String description;
	private String status;
	private Set<ProjectAssignmentTimesheetDetail> projectAssignmentTimesheetDetails= new HashSet<ProjectAssignmentTimesheetDetail>();
	@Transient
	private List<ProjectAssignmentTimesheetDetail> projectAssignmentTimesheetDetailList = new ArrayList<ProjectAssignmentTimesheetDetail>();
	private Map<String, String> stylesMap = new HashMap<String, String>();

	public Long getTimesheetdetailId() {
		return timesheetdetailId;
	}
	public void setTimesheetdetailId(Long timesheetdetailId) {
		this.timesheetdetailId = timesheetdetailId;
	}
	public Timesheet getTimesheet() {
		return timesheet;
	}
	public void setTimesheet(Timesheet timesheet) {
		this.timesheet = timesheet;
	}
	
	public Date getInTime() {
		return inTime;
	}
	public void setInTime(Date inTime) {
		this.inTime = inTime;
	}
	public Date getOutTime() {
		return outTime;
	}
	public void setOutTime(Date outTime) {
		this.outTime = outTime;
	}
	public String getDuration() {
		return duration;
	}
	public void setDuration(String duration) {
		this.duration = duration;
	}
	public Date getCreateDate() {
		return createDate;
	}
	public void setCreateDate(Date createDate) {
		this.createDate = createDate;
	}
	public Date getDateModified() {
		return dateModified;
	}
	public void setDateModified(Date dateModified) {
		this.dateModified = dateModified;
	}
	public String getCreatedBy() {
		return createdBy;
	}
	public void setCreatedBy(String createdBy) {
		this.createdBy = createdBy;
	}
	public String getModifiedBy() {
		return modifiedBy;
	}
	public void setModifiedBy(String modifiedBy) {
		this.modifiedBy = modifiedBy;
	}
	public String getDescription() {
		return description;
	}
	public void setDescription(String description) {
		this.description = description;
	}
	public String getStatus() {
		return status;
	}
	public void setStatus(String status) {
		this.status = status;
	}
	public Date getTimesheetDate() {
		return timesheetDate;
	}
	public void setTimesheetDate(Date timesheetDate) {
		this.timesheetDate = timesheetDate;
	}
	public String getDayOfWeek() {
		return dayOfWeek;
	}
	public void setDayOfWeek(String dayOfWeek) {
		this.dayOfWeek = dayOfWeek;
	}
	public String getInTimeString() {
		return inTimeString;
	}
	public void setInTimeString(String inTimeString) {
		this.inTimeString = inTimeString;
	}
	public String getOutTimeString() {
		return outTimeString;
	}
	public void setOutTimeString(String outTimeString) {
		this.outTimeString = outTimeString;
	}
	public String getActivity() {
		return activity;
	}
	public void setActivity(String activity) {
		this.activity = activity;
	}
	public String getTimesheetDetailStatus() {
		return timesheetDetailStatus;
	}
	public void setTimesheetDetailStatus(String timesheetDetailStatus) {
		this.timesheetDetailStatus = timesheetDetailStatus;
	}
	@Override
	public int compareTo(TimesheetDetail o) {
		return timesheetDate.compareTo(o.getTimesheetDate());
	}
	@Transient
	public Map<String, String> getStylesMap() {
		return stylesMap;
	}
	public void setStylesMap(Map<String, String> stylesMap) {
		this.stylesMap = stylesMap;
	}
	
	public boolean equals(Object obj){
		if(this == obj){
			return true;
		}
		
		if(this.getTimesheetdetailId().equals(((TimesheetDetail)obj).getTimesheetdetailId())){
			return true;
		}
		return false;
	}
	public Set<ProjectAssignmentTimesheetDetail> getProjectAssignmentTimesheetDetails() {
		return projectAssignmentTimesheetDetails;
	}
	public void setProjectAssignmentTimesheetDetails(
			Set<ProjectAssignmentTimesheetDetail> projectAssignmentTimesheetDetails) {
		this.projectAssignmentTimesheetDetails = projectAssignmentTimesheetDetails;
		this.projectAssignmentTimesheetDetailList.clear();
		this.projectAssignmentTimesheetDetailList.addAll(this.projectAssignmentTimesheetDetails);
	}
	public List<ProjectAssignmentTimesheetDetail> getProjectAssignmentTimesheetDetailList() {
		return projectAssignmentTimesheetDetailList;
	}
	public void setProjectAssignmentTimesheetDetailList(
			List<ProjectAssignmentTimesheetDetail> projectAssignmentTimesheetDetailList) {
		this.projectAssignmentTimesheetDetailList = projectAssignmentTimesheetDetailList;
	}
	public String getSecurityPerson() {
		return securityPerson;
	}
	public void setSecurityPerson(String securityPerson) {
		this.securityPerson = securityPerson;
	}

}
